Skip to content

Support go's coverage format #1339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 15, 2025
Merged

Conversation

jasongilanfarr
Copy link
Contributor

Support parsing go's coverage format, effectively converting their "Statement Range" coverage into Line Coverage. Branch Coverage isn't available.

This was hand verified against a larger go report by directly comparing go's html to the grcov generated HTML.

jasongilanfarr and others added 2 commits April 29, 2025 15:44
Support parsing go's coverage format, effectively converting their
"Statement Range" coverage into Line Coverage. Branch Coverage isn't
available.

This was hand verified against a larger go report by directly comparing
go's html to the grcov generated HTML.
pub fn parse_gocov<T: Read>(
reader: &mut BufReader<T>,
) -> Result<Vec<(String, CovResult)>, ParserError> {
let re = Regex::new(r"([^:]+):(\d+)\.\d+,(\d+)\.\d+ (\d+) (\d+)").unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we could compile this only once by saving it in a static variable (can be a follow-up)

Copy link
Collaborator

@marco-c marco-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@marco-c marco-c merged commit 04d111d into mozilla:master May 15, 2025
10 checks passed
@jasongilanfarr
Copy link
Contributor Author

jasongilanfarr commented May 16, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants